home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 2.iso / STUTTGART / LANG / ADA / GNAT / !gcc / adainc / 2 / ads / a-sequio < prev    next >
Text File  |  1996-02-12  |  4KB  |  107 lines

  1. ------------------------------------------------------------------------------
  2. --                                                                          --
  3. --                         GNAT RUNTIME COMPONENTS                          --
  4. --                                                                          --
  5. --                    A D A . S E Q U E N T I A L _ I O                     --
  6. --                                                                          --
  7. --                                 S p e c                                  --
  8. --                                                                          --
  9. --                            $Revision: 1.9 $                              --
  10. --                                                                          --
  11. -- This specification is adapted from the Ada Reference Manual for use with --
  12. -- GNAT.  In accordance with the copyright of that document, you can freely --
  13. -- copy and modify this specification,  provided that if you redistribute a --
  14. -- modified version,  any changes that you have made are clearly indicated. --
  15. --                                                                          --
  16. ------------------------------------------------------------------------------
  17.  
  18.  
  19. with Ada.IO_Exceptions;
  20. with System.Sequential_IO;
  21.  
  22. generic
  23.    type Element_Type (<>) is private;
  24.  
  25. package Ada.Sequential_IO is
  26.  
  27.    type File_Type is limited private;
  28.  
  29.    type File_Mode is (In_File, Out_File, Append_File);
  30.  
  31.    --  The following representation clause allows the use of unchecked
  32.    --  conversion for rapid translation between the File_Mode type
  33.    --  used in this package and System.File_IO.
  34.  
  35.    for File_Mode use
  36.      (In_File     => 0,  -- System.FIle_IO.File_Mode'Pos (In_File)
  37.       Out_File    => 2,  -- System.File_IO.File_Mode'Pos (Out_File)
  38.       Append_File => 3); -- System.File_IO.File_Mode'Pos (Append_File)
  39.  
  40.    ---------------------
  41.    -- File management --
  42.    ---------------------
  43.  
  44.    procedure Create
  45.      (File : in out File_Type;
  46.       Mode : in File_Mode := Out_File;
  47.       Name : in String := "";
  48.       Form : in String := "");
  49.  
  50.    procedure Open
  51.      (File : in out File_Type;
  52.       Mode : in File_Mode;
  53.       Name : in String;
  54.       Form : in String := "");
  55.  
  56.    procedure Close  (File : in out File_Type);
  57.    procedure Delete (File : in out File_Type);
  58.    procedure Reset  (File : in out File_Type; Mode : in File_Mode);
  59.    procedure Reset  (File : in out File_Type);
  60.  
  61.    function Mode    (File : in File_Type) return File_Mode;
  62.    function Name    (File : in File_Type) return String;
  63.    function Form    (File : in File_Type) return String;
  64.  
  65.    function Is_Open (File : in File_Type) return Boolean;
  66.  
  67.    ---------------------------------
  68.    -- Input and output operations --
  69.    ---------------------------------
  70.  
  71.    procedure Read  (File : in File_Type; Item : out Element_Type);
  72.    procedure Write (File : in File_Type; Item : in Element_Type);
  73.  
  74.    function End_Of_File (File : in File_Type) return Boolean;
  75.  
  76.    ----------------
  77.    -- Exceptions --
  78.    ----------------
  79.  
  80.    Status_Error : exception renames IO_Exceptions.Status_Error;
  81.    Mode_Error   : exception renames IO_Exceptions.Mode_Error;
  82.    Name_Error   : exception renames IO_Exceptions.Name_Error;
  83.    Use_Error    : exception renames IO_Exceptions.Use_Error;
  84.    Device_Error : exception renames IO_Exceptions.Device_Error;
  85.    End_Error    : exception renames IO_Exceptions.End_Error;
  86.    Data_Error   : exception renames IO_Exceptions.Data_Error;
  87.  
  88. private
  89.    type File_Type is new System.Sequential_IO.File_Type;
  90.  
  91.    --  All subprograms are inlined
  92.  
  93.    pragma Inline (Close);
  94.    pragma Inline (Create);
  95.    pragma Inline (Delete);
  96.    pragma Inline (End_Of_File);
  97.    pragma Inline (Form);
  98.    pragma Inline (Is_Open);
  99.    pragma Inline (Mode);
  100.    pragma Inline (Name);
  101.    pragma Inline (Open);
  102.    pragma Inline (Read);
  103.    pragma Inline (Reset);
  104.    pragma Inline (Write);
  105.  
  106. end Ada.Sequential_IO;
  107.